<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="<?=STATIC_CSS_URL?>sexy-fashion.css" />
		<script src="<?=PARAM_PATH_JS?>jquery/jquery.js" type="text/javascript"></script>
		<script src="<?=PARAM_PATH_JS?>jquery/jquery-ui.js" type="text/javascript"></script>
		<script src="<?=PARAM_PATH_JS?>jquery/jquery.fancybox.js" type="text/javascript"></script>
	</head>
	<body>
		<div id="wrapper">
			<div id="header">
			</div>
			<div id="slider">
			</div>
			<div id="main_menu">
				<ul>
					<li>
						<a href="<?=SCRIPTURL?>index.php?cmd=main" title="Интернет магазин женского белья">
							<img src="<?=PARAM_PATH_IMG?>main_menu/1.png" alt="Главная"/>
						</a>
					</li>
					<li>
						<a href="<?=SCRIPTURL?>index.php?cmd=discount" title="Как купить белье не дорого">
							<img src="<?=PARAM_PATH_IMG?>main_menu/2.png" alt="Скидки"/>
						</a>
					</li>
					<li>
						<a href="<?=SCRIPTURL?>index.php?cmd=secrets" title="Зачем женщине нижнее белье"> 
							<img src="<?=PARAM_PATH_IMG?>main_menu/3.png" alt="Женские секреты" />
						</a>
					</li>
					<li>
						<a href="<?=SCRIPTURL?>index.php?cmd=faq" title="Как сделать заказ в нашем интернет магазине"> 
							<img src="<?=PARAM_PATH_IMG?>main_menu/4.png" alt="Оплата и доставка"/>
						</a>
					</li>
					<li>
						<a href="<?=SCRIPTURL?>index.php?cmd=contacts" title="Контакты"> 
							<img src="<?=PARAM_PATH_IMG?>main_menu/5.png" alt="Контакты" />
						</a>
					</li>
				</ul>
			</div>
			<div id="main_part">
				<div id="left_menu">
<?php if (!empty($categories)) :?>
					<p id="parentcatselected" style="visibility: hidden;"></p>
					<p>Каталог товаров</p>
					<ul class="menu_chapters">
<?php foreach ($categories as $category): ?>
						<li class="chapter_item">
						<span>
<?php if(empty($category['children'])): ?>
							<a href="<?=SCRIPTURL?>index.php?cmd=category&cat=<?=$category['id']?>"><?=$category['name']?></a>
<?php else: ?>
							<?=$category['name']?>
<?php endif; ?>
						</span>
<?php if (!empty($category['children'])): ?>
							<ul class="menu_items">
<?php foreach ($category['children'] as $category_child): ?>
								<li>
								<a href="<?=SCRIPTURL?>index.php?cmd=category&cat=<?=$category_child['id']?>"><?=$category_child['name']?></a>
								</li>
<?php endforeach; ?>
							</ul>
<?php endif; ?>
<?php endforeach; ?>
					</ul>
<?php endif; ?>
				</div>
				<div id="content">
					<?=$content?>
				</div>
				<div id="right_menu">
					<div id="right_content">
						<form name="auth" id="auth" method="post" action="<?=SCRIPTURL?>">
							<input type="text" name="login" value=""/>
							<input type="password" name="passw" value=""/>
							<p id="loginSubmit">Войти</p>
							<span>забыли пароль?</span>
							<span>Регистрация</span>
						</form>
						<table id="basket">
							<tr>
								<td style="width: 110px; color: #B9BBBD; font-size: 18px;">Ваш заказ</td>
								<td  align="right" >
									<img src="<?=STATIC_URL?>images/empty_basket.png" alt="Ваша корзина (Интернет магазин женского белья)"/>
								</td>
							</tr>
							<tr>
								<td colspan="2">&nbsp;</td>
							</tr>
							<tr>
								<td >Товаров:</td>
								<td width="60" id="basket_total_amount">
									<span><?=isset($_SESSION['basket']['total_amount']) ? $_SESSION['basket']['total_amount'] : 0?></span>&nbsp;шт
								</td>
							</tr>
							<tr>
								<td>Сумма:</td>
								<td width="60" id="basket_total_price">
									<span><?=isset($_SESSION['basket']['total_price']) ? $_SESSION['basket']['total_price'] : 0?></span>&nbsp;грн
								</td>
							</tr>
							
							<tr>
								<td colspan="2">&nbsp;</td>
							</tr>
							<tr>
								<td colspan="2">
									<button name='gotobasket' style="font-size: 0.98em;">Перейти в корзину</button>
								</td>								
								</tr>
						</table>

					</div>
				</div>
			</div>
			<div id="footer">
				<span class="grey">Copyright &copy;2011 sexy-fashion.com.ua . All rights reserved.</span>
			</div>
		</div>
	<script type="text/javascript">
			$(document).ready(function()
				{ 
			    	initMenu();
				
					$("#loginSubmit").click(function(){
						$('#auth').submit();
						});
				});
			
			$("button[name='gotobasket']").attr('style', 'cursor: pointer;').click(function(){
					window.location.href="<?=SCRIPTURL?>index.php?cmd=basket";
				});
			
		    function initMenu()
		    {
				$('.menu_chapters ul').hide();
				
				var p = $('#parentcatselected').html();
     
				if(p){
					$('.menu_chapters ul[id='+p+']').show();
				}

				
				$('.menu_chapters li span').click(function()
				{
					var checkElement = $(this).next();
					if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
						checkElement.slideUp('normal');
					}
					if((checkElement.is('ul')) && (!checkElement.is(':visible'))) 
					{
						$('.menu_chapters ul:visible').slideUp('normal');
						checkElement.slideDown('normal');
						return false;
					}
				});
				
		     }
		</script>
	</body>
</html>